﻿using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Threading;
using System.Resources;
using System.Reflection;

namespace MultiWallpaperManager
{
	static class Program
	{
		private static Mutex mutex;

		[STAThread]
		static void Main()
		{
			const string AppMutexName = "MultiWallpaperManager";

			try
			{
				Mutex.OpenExisting(AppMutexName);

				MessageBox.Show(Resource.ProgramAlreadyRun, Resource.MessageBoxTitle);

				return;
			}
			catch (WaitHandleCannotBeOpenedException ex)
			{
				mutex = new Mutex(true, AppMutexName);
			}

			Application.EnableVisualStyles();
			Application.SetCompatibleTextRenderingDefault(false);
			Application.Run(new MultiWallpaper());
		}
	}
}